package com.cq.hd.product.mapper;

import com.cq.hd.product.po.TbActiveGoodsStockPo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 商品活动库存表 Mapper 接口
 * </p>
 *
 * @author mYunYu
 * @since 2023-11-23
 */
@Mapper
public interface TbActiveGoodsStockMapper extends BaseMapper<TbActiveGoodsStockPo> {

    List<TbActiveGoodsStockPo> listRelActiveByGoodsIds(@Param("goodsIds") List<Long> goodsIds, @Param("now") LocalDateTime now);

    int subFreezeStock(@Param("activeId") Long activeId, @Param("goodsId") String goodsId, @Param("num") Integer num);

    int addFreezeStock(@Param("activeId") Long activeId, @Param("goodsId") String goodsId, @Param("num") Integer num);
}
